<%-- 
    Document   : koperasidetails
    Created on : Jan 8, 2014, 10:26:45 PM
    Author     : lenovo
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@page import="java.util.*" %>
<%@page import="model.Produk" %>
<%@page import="model.Koperasi" %>
<%@page import="database.DBClass"%>
<%@page import="validation.ValidateForm"%>
<%@page import ="java.sql.*" %>
<html>
    <%
        Koperasi koperasi;
        koperasi = new Koperasi();
        koperasi = (Koperasi) request.getAttribute("detailkoperasi");
        String linkproduk = (String) request.getAttribute("linkproduk");
        DBClass dbobject = new DBClass();
    %>
    <head>
        <style type="text/css">
            body {
                background-color:black;
                background-image:url(images/4.jpg); 
            }
        </style>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="<%request.getContextPath();%>/E-Stonion/css/metro-bootstrap.css" rel="stylesheet"> 
        <link href="<%request.getContextPath();%>/E-Stonion/css/metro-bootstrap-responsive.css" rel="stylesheet">

        <script src="<%request.getContextPath();%>/E-Stonion/js/jquery/jquery.min.js"></script>
        <script src="<%request.getContextPath();%>/E-Stonion/js/jquery/jquery.widget.min.js"></script>

        <script src="<%request.getContextPath();%>/E-Stonion/js/metro/metro-*.js"></script>
        <title>Koperasi Detail</title>
    </head>
    <body class="metro">
        <nav class="navigation-bar">
            <nav class="navigation-bar-content">
                <a class="element" href="/E-Stonion/home.jsp">
                    <span class="icon-grid-view"></span>
                    E-Stonion </a>
                <span class="element-divider"></span>
                <a class="element" href="home.jsp">Home</a>
                <a class="element" href="produk.jsp">Produk</a>
                <a class="element" href="koperasi.jsp">Koperasi</a>
                <a class="element" href="aboutus.jsp">About Us</a>
                <span class="element-divider"></span>
                <div class="element input-element place-right">
                    <form method="post" action="<%request.getContextPath();%>/E-Stonion/SearchServlet">
                        <div class="input-control text">
                            <input type="text" name="inputsearch" value="" placeholder="Search...">
                            <button class="btn-search" name="action" value="SearchAll"></button>
                        </div>
                    </form>
                </div>
                <span class="element-divider place-right"></span>
            </nav>
        </nav>



    <center>
        <div class="grid">
            <div class="row bg-white">
                <div class="span3 offset3"><img src="images/koperasi/<%=koperasi.getnamakoperasi()%>.jpg" class="rounded polaroid"></div>
                <div class="span5 offset1"> <p class="text-left"><%=koperasi.getnamakoperasi()%></p> <br> 
                    <p class="text-left"><%=koperasi.getdeskripsikoperasi()%></p>  <br>
                    <p class="text-left"><%=koperasi.getalamatkoperasi()%>, <%=koperasi.getKota()%></p> <br>
                    <p class="text-left"><%=koperasi.getnotelpkoperasi()%></p>
                </div>
            </div>
        </div>
    </center>
    <div>
        <p class="text-left">List Produk</p>
        <table width="100%"border="1" class="table table-striped">
            <tr>
                <th>Nama Produk</th>
                <th>Harga Produk</th>
                <th>Jenis Produk</th>
            </tr>
            <%
                List list = dbobject.getLinkProduk(linkproduk);
                //                request.setAttribute("list", list);
                //            List list = (List) request.getAttribute("list");
                if (list != null) {
                    for (int i = 0; i < list.size(); i++) {
                        Produk uproduk = (Produk) list.get(i);
            %>
            <tr>
                <td><%=uproduk.getnamaproduk()%></td>
                <td>Rp <%=uproduk.gethargaproduk()%></td>
                <td><%=uproduk.getjenisproduk()%></td>
            </tr>
            <%
                    }
                }
            %>
        </table>
    </div>
</body>
</html>
